// components/navigationBar/navigationBar.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    navigationBarTitleText: {
      type: String,
      value: '立码停车商户端'
    },
    navigationBarTitleStyle: {
      type: String,
      value: ''
    },
    navigationBarTitleBlack: {
      type: Boolean,
      value: false
    },
    navigationBarBlackWhite: {
      type: Boolean,
      value: false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    statusBarHeight: 0,
    navigationBarH: 0,
  },
  ready() {
    let systemInfo = wx.getSystemInfoSync()
    let menuButtonBoundingClientRect = wx.getMenuButtonBoundingClientRect()
    this.setData({
      statusBarHeight: systemInfo.statusBarHeight,
      navigationBarH: menuButtonBoundingClientRect.height + (menuButtonBoundingClientRect.top - systemInfo.statusBarHeight) * 2
    })
  },
  /**
   * 组件的方法列表
   */
  methods: {
    navigateBack() {
      wx.navigateBack({
        delta: 1,
        fail(err) {
          wx.reLaunch({
            url: '/pages/index/index',
          })
        }
      })
    }
  }
})
